﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace TS_XY_Train_Repaire.Stuff.Tools
{
    public partial class Stuff_Tools_Change_Password : DevExpress.XtraEditors.XtraForm
    {
        public Stuff_Tools_Change_Password()
        {
            InitializeComponent();
        }

        private void bt_Exit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void bt_Sure_Click(object sender, EventArgs e)
        {
            if (tb_Password.Text.Trim().Length < 4 || tb_Password.Text.Trim().Length > 18)
            {
                MessageBox.Show("密码长度介于4-18位，请重新输入！");
            }
            else
            {
                TS_Win_Class.MySqlCom("update TS_S_T_P_Stuff set f_password='"+DESEncrypt.Encrypt(tb_Password.Text.Trim(), TS_Win_Class._xml_SysSetting_CompanyName)+"' where f_id="+TS_Win_Locomotive_MainForm.pUserInfoMain.GuId);
                MessageBox.Show("完成密码修改，请使用新密码登录！");
                this.Close();
            }
        }
    }
}